<?php
/**
 *  * author 韩天尊
 * Date: 2022/3/15
 * Email: <724700483@qq.com>
 */

namespace App\Toolys;

/**
 * Interface
 */
class InterfaceData
{
    public bool $execute;//是否继续执行
    public $data;//数据
    public string $message;//信息

    public bool $write_back_type;//api 拓展 是否要回復請求源
    //public $code;

    /**
     * @param false $execute 是否继续执行
     * @param null $data
     * @param string $message
     * @param false $write_back_type
     */
    public function __construct(bool $execute=false, $data=null, string $message='', bool $write_back_type=false)
    {
        $this->execute = $execute;
        $this->data = $data;
        $this->message = $message;

        //兼容api拓展
        $this->write_back_type = $write_back_type;
    }

    public function __destruct()
    {
        // TODO: Implement __destruct() method.
    }


    /**
     * 打印数据
     */
    function printData(){
        print_r("print start ----- ");echo PHP_EOL;
        print_r("execute=> {$this->execute}");echo PHP_EOL;
        print_r("data=> {$this->data}");echo PHP_EOL;
        print_r("message=> {$this->message}");echo PHP_EOL;
        print_r("write_back_type=> {$this->write_back_type}");echo PHP_EOL;
        print_r(" ----- print end ");echo PHP_EOL;
    }

    public function test($p1,$p2)
    {
        var_dump(func_get_args());
        var_dump($p1);
        var_dump($p2);
        var_dump("test");
    }

}